package com.nsl.my_youlai.convert;

import com.nsl.my_youlai.model.entity.MajorCategoryEntity;

import com.nsl.my_youlai.model.vo.options.MajorCategoryElSelectOption;
import org.mapstruct.*;
import org.mapstruct.factory.Mappers;

import java.util.List;

//@Mapper(componentModel = MappingConstants.ComponentModel.SPRING) //把该bean交给
@Mapper
public interface MajorCategoryConverter {

    MajorCategoryConverter INSTANCE = Mappers.getMapper(MajorCategoryConverter.class);

    @Mappings({
            @Mapping(target = "value", source = "id"),
    })
    MajorCategoryElSelectOption entity2Option(MajorCategoryEntity majorCategoryEntity);

    @InheritInverseConfiguration(name = "entity2Option")
    MajorCategoryEntity option2Entity(MajorCategoryElSelectOption entity);


    List<MajorCategoryElSelectOption> entities2Options(List<MajorCategoryEntity> majorCategoryEntityList);
}
